<html>
  <head>
    <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Version Control | Notes</title>
<link rel="shortcut icon" href="https://swti.github.io/favicon.ico?v=1591605815270">
<link href="https://cdn.jsdelivr.net/npm/remixicon@2.3.0/fonts/remixicon.css" rel="stylesheet">
<link rel="stylesheet" href="https://swti.github.io/styles/main.css">
<link rel="alternate" type="application/atom+xml" title="Version Control | Notes - Atom Feed" href="https://swti.github.io/atom.xml">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Droid+Serif:400,700">



    <meta name="description" content="What is Version Control?
Version Control is a system that records changes to a file or a set of files over time so that ..." />
    <meta name="keywords" content="git" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css">
    <script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
  </head>
  <body>
    <div class="main">
      <div class="main-content">
        <div class="site-header">
  <a href="https://swti.github.io">
  <img class="avatar" src="https://swti.github.io/images/avatar.png?v=1591605815270" alt="">
  </a>
  <h1 class="site-title">
    Notes
  </h1>
  <p class="site-description">
    温故而知新
  </p>
  <div class="menu-container">
    
      
        <a href="/" class="menu">
          Home
        </a>
      
    
      
        <a href="/archives" class="menu">
          Archive
        </a>
      
    
      
        <a href="/tags" class="menu">
          Tag
        </a>
      
    
      
        <a href="/post/about" class="menu">
          About
        </a>
      
    
  </div>
  <div class="social-container">
    
      
    
      
    
      
    
      
    
      
    
  </div>
</div>

        <div class="post-detail">
          <article class="post">
            <h2 class="post-title">
              Version Control
            </h2>
            <div class="post-info">
              <span>
                2020-05-24
              </span>
              <span>
                2 min read
              </span>
              
                <a href="https://swti.github.io/tag/njAvH1dda/" class="post-tag">
                  # git
                </a>
              
            </div>
            
            <div class="post-content-wrapper">
              <div class="post-content">
                <h2 id="what-is-version-control">What is Version Control?</h2>
<p>Version Control is a system that records <strong>changes</strong> to a file or a set of files <strong>over time</strong> so that you can recall special versions later.</p>
<h2 id="vcs-version-control-system">VCS (Version Control System)</h2>
<h3 id="local-vcss">Local VCSs</h3>
<figure data-type="image" tabindex="1"><img src="https://swti.github.io/post-images/1590333469795.svg" alt="" loading="lazy"></figure>
<blockquote>
<p>One of the most popular Local VCS tools was a system called <a href="https://www.gnu.org/software/rcs/">RCS</a>, which is still distributed with many computers today.</p>
</blockquote>
<h3 id="centralized-vcss-cvcss">Centralized VCSs (CVCSs)</h3>
<p><strong>why?</strong><br>
To deal with the issue that people need to collaborate with developers on other systems.</p>
<blockquote>
<p>such as CVS, Subversion, and Perforce.</p>
</blockquote>
<p>They have a single server that contains all the versioned files, and a number of clients check out files from that central place. For many years, this has been the standard for version control.<br>
<img src="https://swti.github.io/post-images/1590333498035.svg" alt="" loading="lazy"><br>
If that server goes down for an hour, then during that hour nobody can collaborate at all or save versioned changes to anything they're working on. If the hard disk the central database is on becomes corrupted, and proper backups haven't been kept, you lose absolutely everything — the entire history of the project except whatever single snapshots people happen to have on their local machines. Local VCS systems suffer from this same problem.</p>
<blockquote>
<p><strong>whenever you have the entire history of the project in a single place, you risk losing everything.</strong></p>
</blockquote>
<h3 id="distributed-vcss-dvcss">Distributed VCSs (DVCSs)</h3>
<blockquote>
<p>such as git, Mercurial, Bazaar or Darcs.</p>
</blockquote>
<p>In a DVCSs, clients don't just check out the latest snapshot of the files; rather, they fully mirror the repository, including its full history.<br>
<img src="https://swti.github.io/post-images/1590333515584.svg" alt="" loading="lazy"><br>
Furthermore, many of these systems deal pretty well with having several remote repositories they can work with, so you can collaborate with different groups of people in different ways simultaneously within the same project.</p>
<blockquote>
<p>This allows you to set up several types of workflows that aren't possible in centralized systems, such as hierarchical models.</p>
</blockquote>

              </div>
              <div class="toc-container">
                <ul class="markdownIt-TOC">
<li>
<ul>
<li><a href="#what-is-version-control">What is Version Control?</a></li>
<li><a href="#vcs-version-control-system">VCS (Version Control System)</a>
<ul>
<li><a href="#local-vcss">Local VCSs</a></li>
<li><a href="#centralized-vcss-cvcss">Centralized VCSs (CVCSs)</a></li>
<li><a href="#distributed-vcss-dvcss">Distributed VCSs (DVCSs)</a></li>
</ul>
</li>
</ul>
</li>
</ul>

              </div>
            </div>
          </article>
        </div>

        

        

        <div class="site-footer">
  Powered by <a href="https://github.com/getgridea/gridea" target="_blank">Gridea</a>
  <a class="rss" href="https://swti.github.io/atom.xml" target="_blank">
    <i class="ri-rss-line"></i> RSS
  </a>
</div>

      </div>
    </div>

    <script>
      hljs.initHighlightingOnLoad()

      let mainNavLinks = document.querySelectorAll(".markdownIt-TOC a");

      // This should probably be throttled.
      // Especially because it triggers during smooth scrolling.
      // https://lodash.com/docs/4.17.10#throttle
      // You could do like...
      // window.addEventListener("scroll", () => {
      //    _.throttle(doThatStuff, 100);
      // });
      // Only not doing it here to keep this Pen dependency-free.

      window.addEventListener("scroll", event => {
        let fromTop = window.scrollY;

        mainNavLinks.forEach((link, index) => {
          let section = document.getElementById(decodeURI(link.hash).substring(1));
          let nextSection = null
          if (mainNavLinks[index + 1]) {
            nextSection = document.getElementById(decodeURI(mainNavLinks[index + 1].hash).substring(1));
          }
          if (section.offsetTop <= fromTop) {
            if (nextSection) {
              if (nextSection.offsetTop > fromTop) {
                link.classList.add("current");
              } else {
                link.classList.remove("current");    
              }
            } else {
              link.classList.add("current");
            }
          } else {
            link.classList.remove("current");
          }
        });
      });

    </script>
  </body>
</html>
